<html>
<head><meta charset="utf-8"><title>Find rustfix Error clippy#5234 · clippy · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/index.html">clippy</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/Find.20rustfix.20Error.20clippy.235234.html">Find rustfix Error clippy#5234</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="221709435"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/Find%20rustfix%20Error%20clippy%235234/near/221709435" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> xFrednet <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/Find.20rustfix.20Error.20clippy.235234.html#221709435">(Jan 05 2021 at 22:17)</a>:</h4>
<p>Hey, is there a simple way to figure out why rustfix can't apply the suggested changes from a lint? I'm currently working <a href="https://github.com/rust-lang/rust-clippy/issues/5234">clippy#5234</a> which requires me to change an if block in multiple places. The function <code>multispan_sugg_with_applicability</code> seams to be for such suggestions, but I can't get them to work. Is there a simple way to find the reason for this? <a href="https://github.com/rust-lang/rust-clippy/blob/945a41ca2ddd4ba7ef789e9de220e064b04d0e6b/clippy_lints/src/copies.rs#L288-L301">The place that emits the suggestion</a></p>
<p>(flip1995 has already mentioned that I don't need to add an "auto applicable suggestion" for this lint but I at least would like to try ^^)</p>



<a name="221710223"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/Find%20rustfix%20Error%20clippy%235234/near/221710223" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Cameron Steffen <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/Find.20rustfix.20Error.20clippy.235234.html#221710223">(Jan 05 2021 at 22:26)</a>:</h4>
<p>Do you have <code>//run-rustfix</code> at the top of the test file?</p>



<a name="221710303"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/Find%20rustfix%20Error%20clippy%235234/near/221710303" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> xFrednet <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/Find.20rustfix.20Error.20clippy.235234.html#221710303">(Jan 05 2021 at 22:27)</a>:</h4>
<p>Yes, I also get a .fixed file but the suggestions are just not applied -.-</p>



<a name="221710674"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/Find%20rustfix%20Error%20clippy%235234/near/221710674" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Cameron Steffen <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/Find.20rustfix.20Error.20clippy.235234.html#221710674">(Jan 05 2021 at 22:31)</a>:</h4>
<p>Hmm. Maybe try <code>dbg!(suggestions)</code> to validate the spans and the text. <span aria-label="shrug" class="emoji emoji-1f937" role="img" title="shrug">:shrug:</span></p>



<a name="221711213"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/Find%20rustfix%20Error%20clippy%235234/near/221711213" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> flip1995 <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/Find.20rustfix.20Error.20clippy.235234.html#221711213">(Jan 05 2021 at 22:37)</a>:</h4>
<p>rustfix doesn't support multispan suggestions, but silently ignores them. So you can stop trying and save some time :) Using multispan suggestions makes sense in some cases though, because it will give you a nice formatted suggestion.</p>



<a name="221711295"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/Find%20rustfix%20Error%20clippy%235234/near/221711295" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> flip1995 <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/Find.20rustfix.20Error.20clippy.235234.html#221711295">(Jan 05 2021 at 22:38)</a>:</h4>
<p><span class="user-mention" data-user-id="369415">@xFrednet</span> ^ ping, so you don't miss my answer and waste time trying <span aria-label="smile" class="emoji emoji-1f642" role="img" title="smile">:smile:</span></p>



<a name="221711335"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/Find%20rustfix%20Error%20clippy%235234/near/221711335" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> xFrednet <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/Find.20rustfix.20Error.20clippy.235234.html#221711335">(Jan 05 2021 at 22:39)</a>:</h4>
<p>Ahhh okay, that explains a lot... But it makes my job easier ^^</p>



<a name="221711467"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/Find%20rustfix%20Error%20clippy%235234/near/221711467" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> xFrednet <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/Find.20rustfix.20Error.20clippy.235234.html#221711467">(Jan 05 2021 at 22:40)</a>:</h4>
<p>Thank you for the responses! <span aria-label="upside down" class="emoji emoji-1f643" role="img" title="upside down">:upside_down:</span></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>